#include <QCoreApplication>
#include<QtDebug>


int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    QList<QString> list;
    list << "ABCD" << "EFGH" << "HIJK" << "LMNO";
    QListIterator<QString> i(list);

    while(i.hasNext()){
        qDebug()<<i.next();
    }
    while (i.hasPrevious()) {
        qDebug()<<i.previous();

    }

    QList<int> list2;
    list2<< 1 <<3<<2<<5<<55<<22;
    QMutableListIterator<int> i2(list2);
    while (i2.hasNext()) {
        if(i2.next()%2!=0){
            i2.remove();
        }
    }
    foreach(int i,list2){
        qDebug()<<i;
    }

    QMap<QString,QString> map;
    map.insert("Paris","France");
    map.insert("Paris","France");
    map.insert("Moscow","Russia");

    QMutableMapIterator<QString,QString> imap(map);
    while(imap.hasNext()){
        if(imap.next().key().endsWith("City")){
            imap.remove();
        }
    }

    QMap<int,QWidget*> map2;
    QMap<int,QWidget*> hash;

    QMapIterator<int,QWidget*> imap2(map2);
    while (imap2.hasNext()) {
        auto it = imap2.next();
        hash.insert(it.key(),it.value());
    }


    QList<QString> list3;
    list3<<"ABCD" << "EFGH" << "HIJK" << "LMNO";

    QList<QString>::iterator i3;
    for(i3 = list3.begin();i3 != list3.end();i3++){
        *i3 = (*i3).toLower();
    }

    QList<QString>::iterator i4 = list3.end();
    while (i4 != list3.begin()) {
        --i4;
        *i4 = (*i4).toLower();
    }

    QList<QString>::const_iterator i5;
    for(i5 = list3.constBegin();i5!=list3.constEnd();i5++){
        qDebug()<<*i5;
    }

    QMap<QString,QString>::const_iterator imap3;
    for(imap3 = map.constBegin();imap3 != map.constEnd();imap3++){
        qDebug()<<imap3.key()<<":"<<imap3.value();
    }

    return a.exec();
}
